#include "macro-test.h"
#include <iostream>
#include <string>
#include <vector>
#include <map>
#include <algorithm>
#include "stl-test.h"
#include "string-util.h"
#include "ELEngine.h"
#include "d1.h"
#include "algorithm-test.h"
#include "messi.h"
#include "BinarySearch.h"
#include "ConstructorTest.h"
#include "RemoveDuplicateLinkList.h"
#include "GrammarTest.h"
#include "iostream_test.h"
#include "character_encoding_test.h"
#include "string_test.h"
#include "function_template_test.h"
#include "temp_util.h"
#include "feature_for_compatibility.h"


#define TEST_AND_CLEAN(__ELCLASSNAME__, __ELMETHOD__) delete (new (__ELCLASSNAME__))->__ELMETHOD__
#define MESSI_TEST(__ELCLASSNAME__) delete (new (__ELCLASSNAME__))->run()

USING_NS_TEST;
using namespace std;

struct gobalS {
	string s;
};

gobalS gs;

int main() {
	/*
	// test macro.
	MacroTest macroTest;
	macroTest.runTest();

	// test stl.
	STLTest stlTest;
	stlTest.runTest();

	// test singleton.
	ELEngine* engine = ELEngine::getInstance();
	p("instance in main: ");
	psln((engine));
	if (engine) {
	engine->runTest();
	engine->free();
	}

	*/

	/*string str("");
	cin >> str;

	for (int i=str.size()-1; i>=0; --i) {
		printf("%c", str[i]);
	}*
	*/

	//delete ((new ELAlgorithmTest)->runTest());
	
	//TEST_AND_CLEAN(STLTest, testMap());
	//TEST_AND_CLEAN(STLTest, testSorter());
	//MESSI_TEST(BinarySearch);

	/* test contructor's traits from "inside the c++ object" */
	//MESSI_TEST(ConstructorTest);
	//MESSI_TEST(RemoveDuplicateLinkList);

	
	/* global object test 
	psln(gs.s);
	if (gs.s=="") {
		pln("empyt");
	}
	*/

	//MESSI_TEST(RemoveDuplicateLinkList);
	//MESSI_TEST(GrammarTest);
	//TEST_AND_CLEAN(STLTest, testMap());
	//MESSI_TEST(IostreamTest);
	MESSI_TEST(EncodingTest);
    //MESSI_TEST(StringTest);
    //MESSI_TEST(TempUtil);
    //MESSI_TEST(FunctionTemplateTest);
    //MESSI_TEST(FeartureForCompatibility);
	return EXIT_SUCCESS;
}